package dao.common;

import models.entities.PaginatedList;
import models.entities.SiteMapPath;
import models.exceptions.CreateEntityException;
import models.shop.Image;
import models.shop.Product;
import models.shop.path.ProductFilter;

import java.util.List;

public interface ProductManager {
    void save(Product product, int categoryId) throws CreateEntityException;

    Product getById(int id);
    
    Product getById(int id, boolean fetchCategory);

    void clearCache();

    void save(Product product);

    void save(Product product, String categoryTitle);

    List<Product> list(int categoryId);

    List<Product> list(int categoryId, int pageNumber, int pageSize);

    List<Product> listTopProducts(int count);

    SiteMapPath getSitePath(ProductFilter filter);

    PaginatedList<Product> list(ProductFilter filter);

    PaginatedList<Product> search(String query, int pageNumber, int pageSize, int categoryId, int brandId);

    void archive(int productId);

    void restore(int productId);

    void update(Product product);

    Product getForEdit(int productId);

    void deleteImage(int productId, int imageId);

    void addImage(int productId, Image image);

    void save(Product product, Image image);
}
